<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>十分彩网后台管理系统</title>
    <style>
        *{margin:0; padding:0;}
        input{outline: none; border:none; background: none;}
        html,body{width: 100%; height: 100%; overflow: hidden; font-family: "Microsoft Yahei", "hiragino sans gb", Helvetica, Arial, Tahoma;}
        .an-box{width: 100%; height: 100%; background: url("./public/images/anbg.jpg") no-repeat center center; background-size: cover; opacity:0;}
        .an-cnnter{width: 420px; height:300px; background: #fff; border:2px solid #787878; border-radius: 4px; margin:0 auto; position: relative;}
        .anlogo{text-align: center; padding-top: 40px; padding-bottom: 20px; font-size: 26px;}
        .anMode{width: 324px; height: 40px; border:1px solid #dcdcdc; margin:0 auto;  overflow: hidden;}
        .anMode2{border-top:none;}
        .anMode span{display: block; float: left;}
        .anMode .animg{padding-left:28px;padding-top: 12px;}
        .anMode .animg img{display: block;}
        .anMode .aninput{padding-left: 14px;}
        .anMode .aninput input{width: 250px; height:20px; padding:10px 0; font-size: 14px;}
        .anMode .aninputym input{width: 150px; }
        .anMode .anym{display: block; width: 94px; height: 40px; float: right;cursor: pointer;}
        .anModebtn{background: #ff9932; margin-top:20px; border:none;}
        .anModebtn input{width: 100%; height: 100%; background: none; cursor: pointer; color: #fff; font-size: 16px;}
        .zhilogo{background: #fff; width:60px; height:60px; padding:10px; border-radius: 40px; position: absolute; left:170px; top:-40px;}
        .zhilogo img{width:60px; height:60px;}
    </style>
</head>
<body onkeydown="return CheckEnterKey(event)">
<div class="an-box">
    <div class="heighst"></div>
    <div class="an-cnnter">
	
        <div class="zhilogo"><img src="./public/images/logo.png" /></div>
        <div class="anlogo">十分彩网后台管理系统</div>
        <div class="anMode">
            <span class="animg"><img src="./public/images/anicon1.png" alt=""/></span>
            <span class="aninput"><input type="text" placeholder="账号" id="js_admin_name"/></span>
        </div>
        <div class="anMode anMode2">
            <span class="animg"><img src="./public/images/anicon2.png" alt=""/></span>
            <span class="aninput"><input type="password" placeholder="密码" id="admin_pwd"/></span>
        </div>
        <div class="anMode anMode2">
            <span class="animg"><img src="./public/images/anicon3.png" alt=""/></span>
            <span class="aninput aninputym"><input type="text" placeholder="验证码" id="ver"/></span>
            <span class="anym"><img id="yzm" name="yzm" src="index.php?g=admin&m=public&a=yzm" onclick="this.src='index.php?g=admin&m=public&a=yzm&time='+Math.random();" style="cursor: pointer;" width="94px" height="44px" title="点击获取"/></span>
        </div>
        <div class="anMode anModebtn"><input type="button" value="登录" onclick="send()"/></div>
		<div id="msg"></div>
    </div>
</div>


<script src="./public/js/jquery.js"></script>
<script>
    //窗口改变页面自动刷新 开始
    window.onresize=function(){
        location.reload();
    };
    $(".heighst").css("height",($(window).height()-$(".an-cnnter").outerHeight())/2);
    $(function(){
        $(".an-box").css("opacity",1);
    })
function CheckEnterKey(evt) 
{ 
if(evt.keyCode == 13) 
{ 
 send();
} 
}
function send(){
	name = $("#js_admin_name").val();
	pwd = $("#admin_pwd").val();
	verify = $("#ver").val();

	if(name==""){
		$("#msg").html("<center><font color='red'>用户名不能为空</font></center>");
		return false;
	}if(pwd==""){
		$("#msg").html("<center><font color='red'>密码不能为空</font></center>");
		return false;
	}if(verify==""){
		$("#msg").html("<center><font color='red'>验证码不能为空</font></center>");
		return false;
	}
	$.ajax({
                type: "POST",
                url: "{:U('public/dologin')}",
                data: {'username':name,'password':pwd,'verify':verify},
                success: function(msg){
					if(msg==0){
						$("#msg").html("<center><font color='red'>验证码不正确</font></center>");
						return false;
					}if(msg==1){
						$("#msg").html("<center><font color='red'>密码不正确</font></center>");
						return false;
					}if(msg==2){
						$("#msg").html("<center><font color='red'>用户不存在</font></center>");
						return false;
					}if(msg==3){
						$("#msg").html("<center><font color='red'>登录成功</font></center>");
						window.location.href="?g=Admin&m=Index&a=index";
					}
				}
		});
	}
</script>
</body>
</html>